<form id="question-form" class="form-horizontal" action="{:U('Questions/add', array('questionnaire_id'=>$questionnaire['id']))}" method="post">

	<input type="hidden" name="questionnaire_id" value="{$questionnaire.id}">
	<input type="hidden" id="questionnaire_type" value="{$questionnaire.type}">

	<div class="form-group">
	    <blockquote class="blockquote-warning">
	        <h3><strong>添加问题</strong></h3>
	    </blockquote>
	</div>

	<div class="form-group">
	    <label class="col-md-1 col-xs-12 control-label">问题名称</label>
	    <div class="col-md-6 col-xs-12">                                            
	        <input name="name" type="text" class="form-control" value="{$question.name}" />
	    </div>
	</div>

	<div class="form-group">
	    <label class="col-md-1 col-xs-12 control-label">
	    	问题选项
	    </label>
	    <div class="col-md-7 col-xs-12 option-list">
	    	<volist name="optionsList" id="item">
	    		<switch name="item.type">
	    			<case  value="radio">
	    				<div class="option-item radio_option">
	    					<input name="-" type="radio" <?php if(isset($standardList[$i-1]))echo 'checked' ?> />
	    					<div>
	    						<input type="text" value="{$item.text}" class="form-control" placeholder="请输入选项文本" />
	    						<img class="option-del" src="__PUBLIC__/Images/btn-del.png" title="删除该选项">
	    					</div>
	    				</div>
	    			</case>

	    			<case  value="checkbox">
	    				<div class="option-item checkbox_option">
	    					<input type="checkbox" <?php if(isset($standardList[$i-1]))echo 'checked' ?> />
	    					<div>
	    						<input type="text" value="{$item.text}" class="form-control" placeholder="请输入选项文本" />
	    						<img class="option-del" src="__PUBLIC__/Images/btn-del.png" title="删除该选项">
	    					</div>
	    				</div>
	    			</case>

	    			<case  value="text">
	    				<div class="option-item text_option">
	    					<textarea class="form-control">{$standardList}</textarea>
	    					<img class="option-del" src="__PUBLIC__/Images/btn-del.png" title="删除该选项">
	    				</div>
	    			</case>

	    			<case  value="radio_othertext">
	    				<div class="option-item radio_othertext_option">
	    					<input name="-" type="radio" <?php if(isset($standardList[$i-1]))echo 'checked' ?> />
	    					<div>
	    						<strong style="position: absolute;line-height: 25px;">其他：</strong>
	    						<input style="margin-left:40px;opacity: <?php if($questionnaire['type']=='exam')echo '1';else echo '0.3'; ?>;" type="text" class="form-control" value="<?php if(isset($standardList[$i-1]))echo $standardList[$i-1]  ?>" <?php if($questionnaire['type']!='exam')echo 'disabled'; ?> />
	    						<img class="option-del" src="__PUBLIC__/Images/btn-del.png" title="删除该选项">
	    					</div>
	    				</div>
	    			</case>

	    			<case  value="checkbox_othertext">
	    				<div class="option-item checkbox_othertext_option">
	    					<input type="checkbox" <?php if(isset($standardList[$i-1]))echo 'checked' ?> />
	    					<div>
	    						<strong style="position: absolute;line-height: 25px;">其他：</strong>
	    						<input style="margin-left:40px;opacity: <?php if($questionnaire['type']=='exam')echo '1';else echo '0.3'; ?>;" type="text" class="form-control" value="<?php if(isset($standardList[$i-1]))echo $standardList[$i-1]  ?>" <?php if($questionnaire['type']!='exam')echo 'disabled'; ?> />
	    						<img class="option-del" src="__PUBLIC__/Images/btn-del.png" title="删除该选项">
	    					</div>
	    				</div>
	    			</case>
	    		</switch>
	    	</volist>
	    </div>

	    <eq name="questionnaire.type" value="exam">
	    	<input id="standard" name="standard" type="hidden" value='{$question.standard}' />
	    </eq>
	   	<input id="options" name="options" type="hidden" value='{$question.options}' />
	</div>

	<div class="form-group">
	    <label class="col-md-1 col-xs-12 control-label"></label>
	    <div class="col-md-2 col-xs-12">                                            
			<div class="btn-group">
			  <button type="button" class="btn btn-info dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
				<span class="glyphicon glyphicon-plus"></span>
				添 加 选 项 
			  </button>				
			  <ul class="dropdown-menu alter-option-list" role="menu">
			    <li><a type="radio" class="btn" href="#"> 单 选 项 </a></li>
			    <li><a type="checkbox" class="btn" href="#"> 多 选 项 </a></li>
			    <li><a type="text" class="btn" href="#"> 文 本 输 入 </a></li>
			    <li><a type="radio_othertext" class="btn" href="#">单选其他 - 文本</a></li>
			    <li><a type="checkbox_othertext" class="btn" href="#">多选其他 - 文本</a></li>
			  </ul>
			</div>
	    </div>
	    <div class="col-md-6 col-xs-12">
	    	<em id="add-tip">考试卷请直接勾选或填入标准答案!</em>
	    </div>
        <present name="errorNote">
            <div class="alert alert-danger" role="alert">
                <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <strong>{$errorNote}</strong>
            </div>                        
        </present>	    
	</div>

	<div id="question-extendinfo">
		<eq name="questionnaire.type" value="exam">
			<div class="extend-row">
			    <label>分数</label> <input name="score" type="text" class="form-control" value="{$question.score}" />
			</div>
		</eq>

		<div class="extend-row">
		    <label>排序</label> <input name="sort" type="text" class="form-control" value="{$question.sort}" />
		</div>

		<div class="extend-row" style="background: none;">
		    <a id="submit" class="btn btn-info btn-block">提 交 问 题</a>
		</div>
	</div>

</form>